/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vista;

import Control.Controlador;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
import java.util.Observable;
import java.util.Observer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JTextArea;

/**
 *
 * @author Administrador
 */
public class Main_Frame extends JFrame implements MouseListener, Observer {

    private Controlador controlador = null;
    private JPanel jpSelect;
    private JPanel jpDescription;
    private JPanel jpPlayer;
    private JPanel jp1;
    private JPanel jp2;
    private JPanel jp3;
    private JPanel jpPoderes;
    private JPanel jpForce;
    private JPanel jpResistence;
    private JPanel jpSpeed;
    private JPanel jpIntelligence;
    private JPanel jpForce2;
    private JPanel jpResistence2;
    private JPanel jpSpeed2;
    private JPanel jpIntelligence2;
    private JPanel jpInfoPlayer;
    private JPanel jpBody;
    private JPanel jpInfoP;
    private JPanel jpVirgo;
    private JPanel jpSagitario;
    private JPanel jpAries;
    private JPanel jpTauro;
    private JPanel jpBronce;
    private JPanel jpHades;
    private JPanel jpGemenis;
    private JPanel jpRadaman;
    private JPanel jpPlata;
    private JPanel jpBody2;
    private JPanel jpMilicia;
    private JPanel jpBarras;
    private JPanel jpB1;
    private JPanel jpB2;
    private JPanel jpTitulo;
    private JPanel jpB4;
    private JLabel jlSelect;
    private JLabel jlForce;
    private JLabel jlResistance;
    private JLabel jlSpeed;
    private JLabel jlIntelligence;
    private JLabel jlDescription;
    private JLabel jlPlayer;
    private JLabel jlVirgo;
    private JLabel jlBronce;
    private JLabel jlGemenis;
    private JLabel jlHades;
    private JLabel jlMilicia;
    private JLabel jlPlata;
    private JLabel jlRadaman;
    private JLabel jlSagitario;
    private JLabel jlTauro;
    private JLabel jlAries;
    private JLabel jlHit;
    private JLabel jlFail;
    private JLabel jlPlayerTitle;
    private JTextArea jtaInfoPlayer;
    private ImageIcon iiVirgo;
    private ImageIcon iiSagitario;
    private ImageIcon iiAries;
    private ImageIcon iiTauro;
    private ImageIcon iiBronce;
    private ImageIcon iiHades;
    private ImageIcon iiGemenis;
    private ImageIcon iiRadaman;
    private ImageIcon iiPlata;
    private ImageIcon iiMilicia;
    private ImageIcon iiBody;
    private ImageIcon iiStars;
    private JProgressBar jpbHit;
    private JProgressBar jpbFail;

    public Main_Frame(Controlador controlador) {
        this.controlador = controlador;
        jpSelect = new JPanel();
        jpDescription = new JPanel();
        jpPlayer = new JPanel();
        jp1 = new JPanel();
        jp2 = new JPanel();
        jp3 = new JPanel();
        jpPoderes = new JPanel();
        jpForce = new JPanel();
        jpResistence = new JPanel();
        jpSpeed = new JPanel();
        jpIntelligence = new JPanel();
        jpForce2 = new JPanel();
        jpResistence2 = new JPanel();
        jpSpeed2 = new JPanel();
        jpIntelligence2 = new JPanel();
        jpInfoPlayer = new JPanel();
        jpBody = new JPanel();
        jpInfoP = new JPanel();
        jpVirgo = new JPanel();
        jpSagitario = new JPanel();
        jpAries = new JPanel();
        jpTauro = new JPanel();
        jpBronce = new JPanel();
        jpHades = new JPanel();
        jpGemenis = new JPanel();
        jpRadaman = new JPanel();
        jpPlata = new JPanel();
        jpMilicia = new JPanel();
        jpBody2 = new JPanel();
        jpBarras = new JPanel();
        jpB1 = new JPanel();
        jpB2 = new JPanel();
        jpTitulo = new JPanel();
        jpB4 = new JPanel();

        jpbHit = new JProgressBar(0, 100);
        jpbFail = new JProgressBar(0, 100);

        jtaInfoPlayer = new JTextArea();

        jlSelect = new JLabel("Elija su jugador.");
        jlForce = new JLabel("Fuerza:");
        jlForce.setFont(new Font("Arial", Font.BOLD, 16));
        jlResistance = new JLabel("Resistencia:");
        jlResistance.setFont(new Font("Arial", Font.BOLD, 16));
        jlSpeed = new JLabel("Velocidad:");
        jlSpeed.setFont(new Font("Arial", Font.BOLD, 16));
        jlIntelligence = new JLabel("Inteligencia:");
        jlIntelligence.setFont(new Font("Arial", Font.BOLD, 16));
        jlDescription = new JLabel("Bla bla");
        jlPlayer = new JLabel("Aspecto completo de su jugador.");
        jlHit = new JLabel("Acertar:");
        jlFail = new JLabel("Fallar:  ");
        jlPlayerTitle = new JLabel("");

        iiVirgo = new ImageIcon(((new ImageIcon(getClass().getResource("/img/virgo.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiSagitario = new ImageIcon(((new ImageIcon(getClass().getResource("/img/sagitario.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiAries = new ImageIcon(((new ImageIcon(getClass().getResource("/img/aries.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiTauro = new ImageIcon(((new ImageIcon(getClass().getResource("/img/tauro.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiBronce = new ImageIcon(((new ImageIcon(getClass().getResource("/img/bronce.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiHades = new ImageIcon(((new ImageIcon(getClass().getResource("/img/hades.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiGemenis = new ImageIcon(((new ImageIcon(getClass().getResource("/img/gemenis.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiRadaman = new ImageIcon(((new ImageIcon(getClass().getResource("/img/radaman.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiPlata = new ImageIcon(((new ImageIcon(getClass().getResource("/img/plata.JPG")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiMilicia = new ImageIcon(((new ImageIcon(getClass().getResource("/img/milicia.jpg")))
                .getImage()).getScaledInstance(140, 175, Image.SCALE_SMOOTH));
        iiStars = new ImageIcon(((new ImageIcon(getClass().getResource("/img/star.png")))
                .getImage()).getScaledInstance(25, 25, Image.SCALE_SMOOTH));

        jlVirgo = new JLabel(iiVirgo);
        jlBronce = new JLabel(iiBronce);
        jlGemenis = new JLabel(iiGemenis);
        jlHades = new JLabel(iiHades);
        jlMilicia = new JLabel(iiMilicia);
        jlPlata = new JLabel(iiPlata);
        jlRadaman = new JLabel(iiRadaman);
        jlSagitario = new JLabel(iiSagitario);
        jlTauro = new JLabel(iiTauro);
        jlAries = new JLabel(iiAries);


    }

    public void init() {
        create();
        setVisible(true);
        try {
            try {
                controlador.sonido.close();
                controlador.sonido.open(AudioSystem.getAudioInputStream(getClass().getResource("/Aplicacion/inicio.wav")));
                controlador.sonido.start();
                controlador.sonido.loop(Clip.LOOP_CONTINUOUSLY);
            } catch (LineUnavailableException ex) {
                //Logger.getLogger(Main_Frame.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (UnsupportedAudioFileException | IOException ex) {
            //Logger.getLogger(Main_Frame.class.getName()).log(Level.SEVERE, null, ex);
        }
        cuantosEscenarios();


    }

    public void create() {

        jpVirgo.addMouseListener(this);
        jpSagitario.addMouseListener(this);
        jpAries.addMouseListener(this);
        jpTauro.addMouseListener(this);
        jpBronce.addMouseListener(this);
        jpHades.addMouseListener(this);
        jpGemenis.addMouseListener(this);
        jpRadaman.addMouseListener(this);
        jpPlata.addMouseListener(this);
        jpMilicia.addMouseListener(this);

        this.jp1.add(this.jlSelect);
        this.jp1.setBackground(Color.DARK_GRAY);
        this.jp2.setBackground(Color.DARK_GRAY);
        this.jp3.setBackground(Color.DARK_GRAY);
        this.jp2.setLayout(new GridLayout(3, 3));

//        this.jpVirgo.setLayout(new GridBagLayout());
        this.jpVirgo.add(this.jlVirgo);
        this.jpVirgo.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpVirgo);

//        this.jpBronce.setLayout(new GridBagLayout());
        this.jpBronce.add(this.jlBronce);
        this.jpBronce.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpBronce);

//        this.jpAries.setLayout(new GridBagLayout());
        this.jpAries.add(this.jlAries);
        this.jpAries.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpAries);

//        this.jpGemenis.setLayout(new GridBagLayout());
        this.jpGemenis.add(this.jlGemenis);
        this.jpGemenis.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpGemenis);

//        this.jpHades.add(this.jlHades);
//        this.jpHades.setBackground(Color.DARK_GRAY);
//        this.jp2.add(this.jpHades);

//        this.jpPlata.setLayout(new GridBagLayout());
        this.jpPlata.add(this.jlPlata);
        this.jpPlata.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpPlata);

//        this.jpRadaman.setLayout(new GridBagLayout());
        this.jpRadaman.add(this.jlRadaman);
        this.jpRadaman.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpRadaman);

//        this.jpSagitario.setLayout(new GridBagLayout());
        this.jpSagitario.add(this.jlSagitario);
        this.jpSagitario.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpSagitario);

//        this.jpTauro.setLayout(new GridBagLayout());
        this.jpTauro.add(this.jlTauro);
        this.jpTauro.setBackground(Color.DARK_GRAY);
        this.jp2.add(this.jpTauro);

//        this.jpMilicia.setLayout(new GridBagLayout());
        this.jpMilicia.add(this.jlMilicia);
        this.jpMilicia.setBackground(Color.DARK_GRAY);
//        this.jpMilicia.setSize(190, 160);
        this.jp2.add(this.jpMilicia);


        this.jpSelect.setLayout(new BorderLayout());
//        this.jpSelect.add(this.jp1, BorderLayout.NORTH);
        this.jpSelect.add(this.jp2, BorderLayout.CENTER);
//        this.jpSelect.add(this.jp3, BorderLayout.SOUTH);

        this.jlForce.setVisible(false);
        this.jlResistance.setVisible(false);
        this.jlSpeed.setVisible(false);
        this.jlIntelligence.setVisible(false);
        this.jlPlayer.setVisible(false);
        this.jpInfoP.setVisible(false);
        this.jpBody.setVisible(false);
        this.jpBarras.setVisible(false);


        //CENTRO
        this.jpPoderes.setLayout(new GridLayout(4, 2));
        this.jpForce.setLayout(new FlowLayout(FlowLayout.RIGHT));
        this.jpForce.setBackground(Color.DARK_GRAY);
        this.jlForce.setForeground(Color.GRAY.brighter());
        this.jpResistence.setLayout(new FlowLayout(FlowLayout.RIGHT));
        this.jpResistence.setBackground(Color.DARK_GRAY);
        this.jlResistance.setForeground(Color.GRAY.brighter());
        this.jpSpeed.setLayout(new FlowLayout(FlowLayout.RIGHT));
        this.jpSpeed.setBackground(Color.DARK_GRAY);
        this.jlSpeed.setForeground(Color.GRAY.brighter());
        this.jpIntelligence.setLayout(new FlowLayout(FlowLayout.RIGHT));
        this.jpIntelligence.setBackground(Color.DARK_GRAY);
        this.jlIntelligence.setForeground(Color.GRAY.brighter());

        this.jpForce.add(this.jlForce);
        this.jpResistence.add(this.jlResistance);
        this.jpSpeed.add(this.jlSpeed);
        this.jpIntelligence.add(this.jlIntelligence);

        this.jpForce2.setLayout(new FlowLayout(FlowLayout.LEFT));
        this.jpForce2.setBackground(Color.DARK_GRAY);
        this.jpResistence2.setLayout(new FlowLayout(FlowLayout.LEFT));
        this.jpResistence2.setBackground(Color.DARK_GRAY);
        this.jpSpeed2.setLayout(new FlowLayout(FlowLayout.LEFT));
        this.jpSpeed2.setBackground(Color.DARK_GRAY);
        this.jpIntelligence2.setLayout(new FlowLayout(FlowLayout.LEFT));
        this.jpIntelligence2.setBackground(Color.DARK_GRAY);

        this.jpInfoP.setBorder(BorderFactory.createRaisedBevelBorder());
        this.jpInfoP.setBackground(Color.gray.brighter());
        this.jtaInfoPlayer.setEditable(false);
        this.jtaInfoPlayer.setBorder(BorderFactory.createLineBorder(Color.black));
        this.jtaInfoPlayer.setFont(new Font("Arial", Font.BOLD, 16));
        this.jpInfoP.add(this.jtaInfoPlayer);
        this.jpInfoPlayer.setLayout(new GridBagLayout());
        this.jpInfoPlayer.setBackground(Color.DARK_GRAY);
        this.jpInfoPlayer.add(jpInfoP);

        this.jpPoderes.add(this.jpForce);
        this.jpPoderes.add(this.jpForce2);
        this.jpPoderes.add(this.jpResistence);
        this.jpPoderes.add(this.jpResistence2);
        this.jpPoderes.add(this.jpSpeed);
        this.jpPoderes.add(this.jpSpeed2);
        this.jpPoderes.add(this.jpIntelligence);
        this.jpPoderes.add(this.jpIntelligence2);
        this.jpPoderes.setBackground(Color.DARK_GRAY);

        this.jpB1.setBackground(Color.DARK_GRAY);
        this.jpB2.setBackground(Color.DARK_GRAY);
        this.jpTitulo.setBackground(Color.DARK_GRAY);
        this.jpB4.setBackground(Color.DARK_GRAY);
        this.jpB1.add(this.jlHit);
        this.jpB1.add(this.jpbHit);
        this.jpB2.add(this.jlFail);
        this.jpB2.add(this.jpbFail);
        this.jlHit.setFont(new Font("Arial", Font.BOLD, 18));
        this.jlFail.setFont(new Font("Arial", Font.BOLD, 18));
        this.jlHit.setForeground(Color.GRAY.brighter());
        this.jlFail.setForeground(Color.GRAY.brighter());
        this.jpBarras.setLayout(new GridLayout(2, 1));
        this.jpBarras.setBackground(Color.DARK_GRAY);
        this.jpBarras.add(this.jpB1);
        this.jpBarras.add(this.jpB2);
        this.jpBarras.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), "Probabilidad de Ataque", 1, 2, new Font("Arial", Font.BOLD, 16), Color.YELLOW.darker()));
        this.jpbHit.setBorderPainted(true);
        this.jpbHit.setStringPainted(true);
        this.jpbFail.setStringPainted(true);

//        this.jpbHit.setBackground(Color.red);
        this.jpbHit.setForeground(Color.GREEN.darker());
        this.jpbFail.setForeground(Color.RED.darker());
//        this.




        this.jpDescription.setLayout(new BorderLayout());
        this.jpDescription.setBackground(Color.DARK_GRAY);
        this.jpDescription.add(this.jpPoderes, BorderLayout.NORTH);
        this.jpDescription.add(this.jpInfoPlayer, BorderLayout.CENTER);
        this.jpDescription.add(this.jpBarras, BorderLayout.SOUTH);

        //CUERPO

        this.jpBody.setBackground(Color.DARK_GRAY);
        this.jpBody.setBorder(BorderFactory.createRaisedBevelBorder());

        this.jpBody2.setLayout(new GridBagLayout());
        this.jpBody2.setBackground(Color.DARK_GRAY);
        this.jpBody2.add(this.jpBody);
        this.jpPlayer.setBackground(Color.DARK_GRAY);
        this.jlPlayer.setFont(new Font("Arial", Font.BOLD, 18));
        this.jlPlayer.setForeground(Color.gray.brighter());
        this.jpPlayer.setLayout(new BorderLayout());
        this.jpPlayer.add(this.jlPlayer, BorderLayout.NORTH);
        this.jpPlayer.add(this.jpBody2, BorderLayout.CENTER);

        this.jpTitulo.setBackground(Color.DARK_GRAY);
        this.jpTitulo.add(this.jlPlayerTitle);
        this.jlPlayerTitle.setFont(new Font("Arial", Font.BOLD, 24));
        this.jlPlayerTitle.setForeground(Color.GREEN.darker());

        this.setLayout(new BorderLayout());
        this.setBackground(Color.DARK_GRAY);
        this.jpSelect.setBackground(Color.DARK_GRAY);
        this.jpSelect.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.GRAY, 3), "Seleccione jugador", 1, 2, new Font("Arial", Font.BOLD, 16), Color.YELLOW.darker()));
        this.add(this.jpDescription, BorderLayout.CENTER);
        this.add(this.jpSelect, BorderLayout.WEST);
        this.add(this.jpPlayer, BorderLayout.EAST);
        this.add(this.jpTitulo, BorderLayout.NORTH);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setResizable(false);
        this.setSize(1231, 660);
        this.setLocationRelativeTo(null);
//        this.pack();
//        System.out.println(this.getWidth());
//        System.out.println(this.getHeight());


    }

    public void InfoPlayer(int force, int resistence, int speed, int intelligence, String url, int hit, int fail, String name, String info) {
        this.jpForce2.removeAll();
        this.jpResistence2.removeAll();
        this.jpSpeed2.removeAll();
        this.jpIntelligence2.removeAll();
        this.jpBody.removeAll();
        this.jtaInfoPlayer.setText(info);

        this.jlPlayerTitle.setText(name);

        this.jpbHit.setValue(hit);
        this.jpbFail.setValue(fail);

        for (int i = 0; i < force; i++) {
            this.jpForce2.add(new JLabel(iiStars));
        }
        for (int i = 0; i < resistence; i++) {
            this.jpResistence2.add(new JLabel(iiStars));
        }
        for (int i = 0; i < speed; i++) {
            this.jpSpeed2.add(new JLabel(iiStars));
        }
        for (int i = 0; i < intelligence; i++) {
            this.jpIntelligence2.add(new JLabel(iiStars));
        }

        iiBody = new ImageIcon(((new ImageIcon(getClass().getResource(url)))
                .getImage()).getScaledInstance(320, 550, Image.SCALE_SMOOTH));
        this.jpBody.add(new JLabel(iiBody));

        this.jlForce.setVisible(true);
        this.jlResistance.setVisible(true);
        this.jlSpeed.setVisible(true);
        this.jlIntelligence.setVisible(true);
        this.jlPlayer.setVisible(true);
        this.jpInfoP.setVisible(true);
        this.jpBody.setVisible(true);
        this.jpBarras.setVisible(true);
        this.jpDescription.updateUI();

    }

    public boolean confirmUsePlayer() {
        Object[] options = {"Si quiero!",
            "No quiero!"};
        int n = JOptionPane.showOptionDialog(null,
                "Quiere usar este Caballero de Zodiaco?",
                "Escoja su caballero",
                JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null, //do not use a custom Icon
                options, //the titles of buttons
                options[0]); //default button title

        if (n == 0) {
            controlador.sonido.close();
            return true;
        } else {
            return false;
        }
    }

    private void cuantosEscenarios() {
        Object o[] = {"1", "2", "3", "4", "5"};
        String s;
        do {
            s = (String) JOptionPane.showInputDialog(
                    null,
                    "Cantos escenarios quiere simular :\n",
                    "Cantidad de escenarios",
                    JOptionPane.PLAIN_MESSAGE,
                    null,
                    o,
                    "Espada..");
        } while (s == null);
        controlador.escenarios = Integer.parseInt(s);


    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (e.getSource() == jpVirgo) {
            if (confirmUsePlayer()) {
                controlador.initGame("Virgo");
                this.dispose();
            }
        } else if (e.getSource() == jpSagitario) {
            if (confirmUsePlayer()) {
                controlador.initGame("Sagitario");
                this.dispose();
            }
        } else if (e.getSource() == jpAries) {
            if (confirmUsePlayer()) {
                controlador.initGame("Aries");
                this.dispose();
            }
        } else if (e.getSource() == jpTauro) {
            if (confirmUsePlayer()) {
                controlador.initGame("Tauro");
                this.dispose();

            }
        } else if (e.getSource() == jpBronce) {
            if (confirmUsePlayer()) {
                controlador.initGame("Caballeros de bronce");
                this.dispose();

            }
        } else if (e.getSource() == jpHades) {
            if (confirmUsePlayer()) {
                controlador.initGame("Hades");
                this.dispose();
            }
        } else if (e.getSource() == jpGemenis) {
            if (confirmUsePlayer()) {
                controlador.initGame("Gemenis");
                this.dispose();
            }
        } else if (e.getSource() == jpRadaman) {
            if (confirmUsePlayer()) {
                controlador.initGame("Radaman");
                this.dispose();
            }
        } else if (e.getSource() == jpPlata) {
            if (confirmUsePlayer()) {
                controlador.initGame("Caballeros de plata");
                this.dispose();
            }
        } else if (e.getSource() == jpMilicia) {
            if (confirmUsePlayer()) {
                controlador.initGame("Milicia");
                this.dispose();
            }
        }


    }

    @Override
    public void mousePressed(MouseEvent e) {
    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        e.getComponent().setBackground(Color.YELLOW.brighter());
        if (e.getSource() == jpVirgo) {
            this.InfoPlayer(5, 5, 4, 5, "/img/virgoC.jpg", 95, 5, "Caballero de Virgo",
                    "     El caballero de Virgo es \n probablemente el más poderoso de todos. \n"
                    + " Debido a su práctica en la \n meditación y las enseñanzas budistas \n"
                    + " tiene una serenidad fuera de lo común.\n Siempre mantiene los ojos \n"
                    + " cerrados, incluso durante un combate,\n y se dice que cuando los abre, \n"
                    + " toda vida a su alrededor es extinguida.\n De Virgo se ha dicho que es \n"
                    + " el caballero dcon el poder más cercano\n al de un dios. Tiene poderes \n"
                    + " mentales fuera de lo común que le \n permiten moverse entre dimensiones. ");
        } else if (e.getSource() == jpSagitario) {
            this.InfoPlayer(3, 5, 5, 4, "/img/sagitarioC.jpg", 80, 20, "Caballero de Sagitario",
                    "     El Caballero de Sagitario,  \n "
                    + " antíguo portador de dicha   \n"
                    + " armadura y de la casa del  \n"
                    + " Santuario del mismo nombre.  \n"
                    + " A pesar de que otros estaban  \n"
                    + " considerados como los más fieles \n"
                    + " a Atenea.");
        } else if (e.getSource() == jpAries) {
            this.InfoPlayer(2, 3, 5, 5, "/img/ariesC.jpg", 80, 10, "Caballero de Aries",
                    "     El caballero de oro del \n"
                    + " signo de Aries. Probablemente \n"
                    + " junto con Virgo, sea el más \n"
                    + " noble de todos los caballeros \n"
                    + " de oro. Fue el primero de \n"
                    + " todos ellos que confió en la \n"
                    + " cruzada de los caballeros de \n"
                    + " bronce sin hacerles frente.");
        } else if (e.getSource() == jpTauro) {
            this.InfoPlayer(2, 5, 1, 1, "/img/tauroC.jpg", 50, 50, "Caballero de Tauro",
                    "     El Caballero de Tauro, \n"
                    + " sin dejar de ser un poderoso \n"
                    + " Caballero de Oro, es \n"
                    + " probablemente uno de los \n"
                    + " más débiles entre todos ellos, \n"
                    + " y seguramente también uno de \n"
                    + " los más desafortunados.");
        } else if (e.getSource() == jpBronce) {
            this.InfoPlayer(2, 1, 2, 4, "/img/bronceC.jpg", 80, 20, "Caballeros de Bronce",
                    "     Caballeros de bronce.");
        } else if (e.getSource() == jpHades) {
            this.InfoPlayer(5, 5, 5, 5, "/img/hadesC.jpg", 80, 20, "Hades",
                    "     El jefe final. Es uno de \n"
                    + " los principales antagonistas \n"
                    + " de la historia. Empieza con \n"
                    + " 500 puntos de vida.");
        } else if (e.getSource() == jpGemenis) {
            this.InfoPlayer(5, 5, 2, 1, "/img/gemenisC.jpg", 40, 60, "Caballero de Géminis",
                    "     Fue el caballero de \n"
                    + " Géminis hasta su suicidio \n"
                    + " ante Atenea. Empieza con \n"
                    + " 500 vida");
        } else if (e.getSource() == jpRadaman) {
            this.InfoPlayer(5, 4, 3, 3, "/img/radamanC.jpg", 80, 20, "Radamanthys",
                    "     Radaman es uno de los \n"
                    + " tres Jueces y el primer juez \n"
                    + " en ser presentado, junto con \n"
                    + " Pandora. Como parte de la \n "
                    + " élite guerrera del ejército \n"
                    + " de Hades, le corresponde \n"
                    + " comandar y dirigir las acciones \n"
                    + " de una tropa de espectros a su \n"
                    + " cargo.Empieza con 500 vida ");
        } else if (e.getSource() == jpPlata) {
            this.InfoPlayer(2, 3, 1, 1, "/img/plataC.JPG", 50, 50, "Caballeros de Plata",
                    "     Caballeros de plata Misty \n"
                    + " y Moses.Su barra de vida de \n"
                    + " entre ambos es de 400. Es \n "
                    + " decir 200 para cada personaje. \n"
                    + " Uno de ellos cae primero que \n"
                    + " el otro (Moses).");
        } else if (e.getSource() == jpMilicia) {
            this.InfoPlayer(1, 1, 1, 1, "/img/miliciaC.jpg", 60, 40, "Milicia",
                    "     La milicia. Su fuerza \n "
                    + "la hace la cantidad");
        }



    }

    @Override
    public void mouseExited(MouseEvent e) {
        e.getComponent().setBackground(null);

    }

    @Override
    public void update(Observable o, Object arg) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
